<template>
  <div>
    <div class="do_score" v-if="shopLis">
      <div class="left">
        <h3>{{ shopLis.score }}</h3>
        <p>综合评分</p>
        <p>高于周边商家{{ shopLis.rankRate }}%</p>
      </div>
      <div class="star">
        <div class="items">
          <span>
            <strong class="ServiceAattitude">服务态度</strong>
            <van-rate
              v-model="serve_light"
              :size="18"
              color="#ffd21e"
              void-icon="star"
              void-color="#eee"
            />
            <strong class="ServiceScore">{{ shopLis.serviceScore }}</strong>
          </span>
        </div>
        <div class="items">
          <span>
            <strong class="ServiceAattitude">商品评分</strong>
            <van-rate
              v-model="attitude_light"
              :size="18"
              color="#ffd21e"
              void-icon="star"
              void-color="#eee"
            />
            <strong class="ServiceScore">{{ shopLis.foodScore }}</strong>
          </span>
        </div>
        <div class="items">
          <span>
            <strong class="ServiceAattitude">送达时间</strong>
            <span class="time">{{ shopLis.deliveryTime }}分钟</span>
          </span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  data() {
    return {
      serve_light: 5,
      attitude_light: 1
    }
  },
  computed: {
    ...mapState(['shopLis'])
  }
}
</script>

<style lang="less" scoped>
.do_score {
  background-color: #fff;
  border-top: 1px solid #ccc;
  overflow: hidden;
  padding: 16px 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  .left {
    height: 100px;
    width: 120px;
    border-right: 1px solid #ccc;
    float: left;
    text-align: center;
    h3 {
      color: gold;
      font-size: 25px;
      margin-top: 10px;
    }
    p {
      font-size: 10px;
      &:nth-child(2) {
        margin: 6px 0;
        font-weight: 600;
      }
      &:nth-child(3) {
        color: #ccc;
      }
    }
  }
  .star {
    float: left;
    padding: 0 10px;
    padding-top: 10px;
    .van-rate {
      vertical-align: middle;
    }
    .items:nth-child(2) {
      margin: 10px 0;
    }
    .time {
      vertical-align: middle;
      font-size: 15px;
      color: #999;
    }
    .ServiceAattitude {
      padding-right: 10px;
      font-size: 13px;
      font-weight: 600;
      vertical-align: middle;
    }
    .ServiceScore {
      padding-left: 10px;
      color: gold;
      font-size: 20px;
      vertical-align: middle;
    }
  }
  .stars {
    height: 20px;
    width: 20px;
    display: inline-block;
    vertical-align: middle;
    padding: 0 2px;
    img {
      width: 100%;
    }
  }
}
</style>
